package job.sql.remove_duplicated;

import java.io.IOException;

import mapred.base.TextMapper;

import org.apache.hadoop.io.Text;

public class Sql_RemoveDuplicated_Page_Mapper extends TextMapper {

    private static int N = 0;

    private static int m = 0;

    @Override
    public void map(Text key, Text value) throws IOException {
        int hash = Math.abs(key.toString().hashCode() % N);
        if (hash == m) {
            this.output(key, value);
        }
    }

    @Override
    public void setUp() {
        N = Integer.parseInt(this.getConfig("N"));
        m = Integer.parseInt(this.getConfig("m"));
    }

    @Override
    public void tearDown() throws IOException {
    }

}
